package com.icode.core.model.house;

import com.icode.core.model.user.City;
import com.icode.core.model.user.District;
import com.icode.core.model.user.Province;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: SunKai
 * Date: 14-11-1
 * Time: 下午2:49
 * To change this template use File | Settings | File Templates.
 */
@Embeddable
public class HouseBaseInfo {

    @Column(name = "house_name")
    private String houseName;

    @Column(name = "house_feature")
    private String houseFeature;

    @Column(name = "price")
    private String price;

    private String title;
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "title_image_id")
    private UploadImage titleImage;

    private String developers;
    private String permits;
    @ManyToOne
    @JoinColumn(name = "province")
    private Province province;
    @ManyToOne
    @JoinColumn(name = "city")
    private City city;
    @ManyToOne
    @JoinColumn(name = "district")
    private District district;
    @Column(name = "area")
    private String area;

    @Column(columnDefinition = "bit", name = "fine_room")
    private boolean fineRoom;


    public HouseBaseInfo() {
    }

    public HouseBaseInfo(String houseName, String houseFeature, String price, String title, UploadImage titleImage, boolean fineRoom) {
        this.houseName = houseName;
        this.houseFeature = houseFeature;
        this.price = price;
        this.title = title;
        this.titleImage = titleImage;
        this.fineRoom = fineRoom;
    }

    public String houseName() {
        return houseName;
    }

    public String houseFeature() {
        return houseFeature;
    }

    public String title() {
        return title;
    }

    public UploadImage titleImage() {
        return titleImage;
    }

    public String price() {
        return price;
    }


    public String developers() {
        return developers;
    }

    public String permits() {
        return permits;
    }

    public Province province() {
        return province;
    }

    public City city() {
        return city;
    }

    public boolean fineRoom() {
        return fineRoom;
    }

    public void setFineRoom(boolean fineRoom) {
        this.fineRoom = fineRoom;
    }

    public District district() {
        return district;
    }

    public String area() {
        return area;
    }
}
